#ifndef CAMERA_H
#define CAMERA_H

#include <GameGlobals.h>
class BaseObject;

class Camera
{
	public:

		Camera();
		~Camera();

		void Input(const bool* keys, float fps );
		void ResizeWindow(int w, int h);

		void SetWindowPos(float x, float y);
		void MoveWindowPos(float dx, float dy);
		void ZoomWindow(float delta);
		void SetWindowZoom(float zoom);
		void ChangeScrollSpeed(float delta);
		void SetScrollSpeed(float speed);

		unsigned int GetW() const { return width; }
		unsigned int GetH() const { return height; }
		float GetX() const { return viewCenter_x; }
		float GetY() const { return viewCenter_y; }
		vec2 GetPos() const { return vec2( viewCenter_x, viewCenter_y ); }

		void SetTarget( BaseObject* t );
		truth HasTarget();
		void ClearTarget();
		void SyncWithTarget(float dt = 0.016f);

		void SetDebugMode(truth state);
	
	private:
		float scrollSpeed;
		float viewCenter_x;
		float viewCenter_y;
		float viewZoom;

		const unsigned& width;
		const unsigned& height;

		BaseObject* target;

		BaseObject* debug_savedTarget;
		truth debugMode;
};


#endif